import React from 'react'
export default class Ipt extends React.Component {
    state={
        txt:''
    }
    /* handleIput=(e)=>{
        console.log(e.target.value);
        this.setState({
            txt:e.target.value
        })
    }
    render() {
        return (
            <div>类组件==={this.state.txt}
                <input value={this.state.txt} onChange={this.handleIput} type='text' />
            </div>
        )
    } */
    
    render() {
        return (
            <div>类组件==={this.state.txt}
                <input value={this.state.txt} onChange={(e)=>this.setState({txt:e.target.value}) }type='text' />
            </div>
        )
    }
}